package com.kl.feign;

import com.kl.domain.CityOrderDTO;
import com.kl.domain.LineDTO;
import com.kl.em.ConstantEnum;
import com.kl.em.Result;
import com.kl.feign.fallback.SameCityServiceFeignFallback;
import com.kl.feign.fallback.UserServiceFeignFallback;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@FeignClient(value = "kunlun-samecity-service-a",fallback = SameCityServiceFeignFallback.class)//服务名找项目
public interface SameCityServiceFeign {

    //同城订单id查询接口
    @GetMapping("/cityOrderController/selectById")
    Result<CityOrderDTO> selectById(@RequestParam("id") Long id);

    //同城订单寄货人电话查询接口
    @GetMapping("/cityOrderController/selectBySendPhone")// @ResponseBody  将后台的数据以json的格式返回前台
    Result<List<CityOrderDTO>> selectBySendPhone(@RequestParam("sendPhone") String sendPhone);

    //同城订单收货人电话查询接口
    @GetMapping("/cityOrderController/selectByConsigneePhone")// @ResponseBody  将后台的数据以json的格式返回前台
    Result<List<CityOrderDTO>> selectByConsigneePhone(@RequestParam("consigneePhone") String consigneePhone);

    //同城订单员工id查询执行单接口
    @GetMapping("/cityOrderController/selectByStaffId")// @ResponseBody  将后台的数据以json的格式返回前台
    Result<List<CityOrderDTO>> selectByStaffId(@RequestParam("staffId") String staffId);

    //同城订单同城空闲单查询接口
    @GetMapping("/cityOrderController/selectByMeetStatus")// @ResponseBody  将后台的数据以json的格式返回前台
    Result<List<CityOrderDTO>> selectByMeetStatus();

    //同城订单增加接口
    @PostMapping// @ResponseBody  将后台的数据以json的格式返回前台
    Result insertById(@RequestBody CityOrderDTO cityOrderDTO);

    //同城订单修改寄件人信息接口
    @PutMapping("/cityOrderController/updateConsigneeById")
    Result updateConsigneeById(@RequestParam("id")Long id,
                                      @RequestParam("consigneeName")String consigneeName,
                                      @RequestParam("consigneePhone")String consigneePhone,
                                      @RequestParam("consigneeAddress")String consigneeAddress);

    //同城订单接单成功接口
    @PutMapping("/cityOrderController/updateConsigneeBySuccess")
    Result updateConsigneeBySuccess(@RequestParam("id")Long id,@RequestParam("staffId")Long staffId);

    //同城订单接单员已取货接口
    @PutMapping("/cityOrderController/updatePickedUp")
    Result updatePickedUp(@RequestParam("id")Long id,
                                 @RequestParam("serialNumber")String serialNumber,
                                 @RequestParam("alyOrderNember")String alyOrderNember);

    //同城订单完成接口
    @PutMapping("/cityOrderController/updateCompletion")
    Result updateCompletion(@RequestParam("id")Long id);

    //同城订单超时接口
    @PutMapping("/cityOrderController/updateOvertime")
    Result updateOvertime(@RequestParam("id")Long id);

    //同城订单退单接口
    @PutMapping("/cityOrderController/updateChargeback")
    Result updateChargeback(@RequestParam("id")Long id);

    //同城派送员抢单接口
    @PutMapping("/cityOrderController/grabOder")
    Result grabOder(@RequestParam("id")Long id,@RequestParam("staffId")Long staffId);
}
